package com.hbnu.system.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hbnu.system.core.base.CommonPage;
import com.hbnu.system.core.base.Rest;
import com.hbnu.system.model.dto.FundsConditionPageDTO;
import com.hbnu.system.model.entity.FundsCondition;
import com.hbnu.system.service.FundsConditionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/fundscondition")
@Api(tags = "经费模块")
public class FundsConditionController {
    @Autowired
    FundsConditionService fundsConditionService;

    @ApiOperation("经费-分页查询")
    @PostMapping("/pagecondition")
    public Rest<CommonPage<FundsCondition>> pageProjectCondition(@RequestBody FundsConditionPageDTO searchTaskDTO){
        IPage<FundsCondition> page = fundsConditionService.pageCondition(searchTaskDTO);
        CommonPage<FundsCondition> activityVOCommonPage = CommonPage.restPage(page);
        return Rest.success(activityVOCommonPage);
    }
}
